<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        [tit]{
            position: relative;
            cursor: pointer;
        }
        [tit]:hover::before{
            position: absolute;
            content: attr(tit);
            max-width: 300px;
            min-height: 100px;
            padding: 4px 10px;
            background: #0007;
            color: #fff;
            top: 100px;
        }
    </style>
</head>
<body>
    <div tit="提示文本">DEMO文字</div>
</body>
</html>